<!DOCTYPE HTML>
<html>

<head>
    <!--#header start-->
    {include file="public/_meta" /}
    <!--#header end-->
    <title>中欧品牌</title>
</head>

<body>
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span> 中欧品牌
        <span class="c-gray en">&gt;</span> 品牌简介
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray">
            <span class="l">
			  <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">
					<i class="Hui-iconfont">&#xe6e2;</i>
					批量删除
				</a>
			  <a class="btn btn-primary radius" href="javascript:;" onclick="admin_add('添加内容','{:url('Brand/ppjjCreate')}','800')">
				 <i class="Hui-iconfont">&#xe600;</i>
				  添加内容
				</a>
			</span>
            <!-- <span class="r">共有数据：<strong>3</strong> 条</span>  -->
        </div>
        <table class="table table-border table-bordered table-hover table-bg">
            <thead>
                <tr>
                    <th scope="col" colspan="11">品牌简介</th>
                </tr>
                <tr class="text-c">
                    <th width="25"><input type="checkbox" name="" value=""></th>
                    <th width="40">ID</th>
                    <th width="80">标题</th>
                    <th width="140">加入时间</th>
                    <th width="200">内容</th>
                    <th width="100">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr class="text-c">
                    <td><input type="checkbox" value="3" name="id[]"></td>
                    <td>3</td>
                    <td>陈润璇</td>
                    <td>2017-03-18 14:59:56</td>
                    <td>本系统开发者：傻大目</td>
                    <td class="td-manage">

                        <a class="btn btn-warning-outline radius size-MINI" title="编辑" href="javascript:;" onclick="admin_edit('角色编辑','/admin/admin_user/edit.html','3')" style="text-decoration:none">
                            <i class="Hui-iconfont"></i>
                        </a>
                        <a class="btn btn-danger-outline radius size-MINI" title="删除" href="javascript:;" onclick="admin_del(this,'3')" style="text-decoration:none">
                            <i class="Hui-iconfont"></i>
                        </a>

                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <!--#header start-->
    {include file="public/_footer" /}
    <!--#header end-->

    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript" src="__ADMIN__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
    <script type="text/javascript">
        /*管理员-角色-添加*/
        function admin_add(title, url, w, h) {
            layer_show(title, url, w, h);
        }
        /*管理员-角色-编辑*/
        function admin_edit(title, url, id, w, h) {
            layer_show(title, url + '?id=' + id, w, h);
        }
        /*管理员-角色-删除*/
        function admin_del(obj, id) {
            layer.confirm('管助者删除须谨慎，确认要删除吗？', function(index) {
                $.ajax({
                    type: 'DELETE',
                    url: "{:url('AdminUser/delete')}",
                    data: {
                        id: id
                    },
                    dataType: 'json',
                    success: function(data) {
                        if (data.state) {
                            $(obj).parents("tr").remove();
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 1000
                            });
                        } else {
                            layer.msg(data.msg, {
                                icon: 5,
                                time: 1000
                            });
                        }
                    },
                    error: function(data) {
                        //console.log(data.msg);
                    },
                });
            });
        }

        /*管理员-批量删除*/
        function datadel(obj) {
            var chk_value = [];
            $('input[name="id[]"]:checked').each(function() {
                chk_value.push($(this).val());
            });
            if (chk_value.length == 0) {
                layer.msg('未选中任意项', {
                    icon: 5,
                    time: 1000
                });
            } else {
                $.ajax({
                    type: 'DELETE',
                    url: "{:url('AdminUser/allDelete')}",
                    data: {
                        id: chk_value
                    },
                    dataType: 'json',
                    success: function(data) {
                        if (data.state) {
                            layer.msg(data.msg, {
                                icon: 1,
                                time: 1000
                            });
                        } else {
                            layer.msg(data.msg, {
                                icon: 5,
                                time: 1000
                            });
                        }
                    }
                });
            }

        }
    </script>
</body>

</html>